package cn.wolfcode.enums;

import lombok.Getter;

/**
 * @author JMJ
 * @date 2021/1/14 17:18
 */
@Getter
public enum NoticeStatusEnum {
    IMPORTANT("重要", 0L),
    COMMONLY("一般", 1L),
    ORDINARY("普通", 2L);



    private String name;
    private Long value;

    private NoticeStatusEnum(String name, Long value) {
        this.name = name;
        this.value = value;
    }

    public static String findName(Long value) {
        //获取所有实例
        NoticeStatusEnum[] enums = values();
        for (NoticeStatusEnum anEnum : enums) {
            if (anEnum.value.equals(value)) {
                return anEnum.name;
            }
        }
        return null;
    }

}
